package com.gpframework.module.module.domain.req;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gpframework.common.utils.StringUtils;
import com.gpframework.module.base.domain.req.BaseReq;
import com.gpframework.module.module.domain.GpYiliInventoryInformation;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.math.BigDecimal;

import java.util.Date;

/**
 * @ClassName GpYiliInventoryInformationReq
 * @Author gpframework
 * @Date 2024-02-22
 * @Version 1.0.0
 * @Description 列表查询信息体
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
public class GpYiliInventoryInformationReq extends BaseReq {
    private static final long serialVersionUID = 1L;

         @ApiModelProperty("${column.columnComment}")
     private Long id;
     @ApiModelProperty("品牌id")
     private String brandId;
     @ApiModelProperty("品牌名称")
     private String brandName;
     @ApiModelProperty("品名")
     private String productName;
     @ApiModelProperty("树形分类")
     private String treeClassification;
     @ApiModelProperty("别名")
     private String byname;
     @ApiModelProperty("颜色")
     private String colour;
     @ApiModelProperty("条数")
     private String numberOfItems;
     @ApiModelProperty("数量")
     private String number;
     @ApiModelProperty("单位")
     private String unit;
     @ApiModelProperty("备注")
     private String remarks;

    /**
    * @Description 生成查询wrapper
    * @Author greatplan@qq.com
    * @Date 2020-11-04 16:04
    * @Param [lqw]
    * @Param [isVO] 是否vo查询体，true的话走的是mapper.xml里面的查询语句，不过查询语法还是mybatis-plus，主要用于某些关联查询出一些非数据表字段
    * @Return void
    */
    public void generatorQuery(QueryWrapper<GpYiliInventoryInformation> lqw,boolean isVo) {
        String alias = "";
        if (isVo) {
            alias = "gp.";
            lqw.eq(alias+"del_status",0);
        }
        if (this.getId() != null){
        lqw.eq(alias+"id" ,this.getId());
        }
        if (StringUtils.isNotBlank(this.getBrandId())){
        lqw.eq(alias+"brand_id" ,this.getBrandId());
        }
        if (StringUtils.isNotBlank(this.getBrandName())){
            lqw.like(alias+"brand_name",this.getBrandName());
        }

        if (StringUtils.isNotBlank(this.getTreeClassification())){
        lqw.eq(alias+"tree_classification" ,this.getTreeClassification());
        }
        if (StringUtils.isNotBlank(this.getByname())){
            lqw.like(alias+"byname",this.getByname());
        }
        if (StringUtils.isNotBlank(this.getColour())){
        lqw.like(alias+"colour" ,this.getColour());
        }
        if (StringUtils.isNotBlank(this.getNumberOfItems())){
        lqw.eq(alias+"number_of_items" ,this.getNumberOfItems());
        }
        if (StringUtils.isNotBlank(this.getNumber())){
        lqw.eq(alias+"number" ,this.getNumber());
        }
        if (StringUtils.isNotBlank(this.getUnit())){
        lqw.eq(alias+"unit" ,this.getUnit());
        }
        if (StringUtils.isNotBlank(this.getRemarks())){
        lqw.eq(alias+"remarks" ,this.getRemarks());
        }
    }
}
